#include "wall.h"
#include <QGraphicsScene>
#include <QPainter>
#include <QStyleOption>

Wall::Wall(int Tx , int Ty , int Tangle , int Tlength , int Twidth)
{
    x = Tx;
    y = Ty;
    setPos (x , y);
    angle = Tangle;
    setRotation (angle);
    length = Tlength;
    type = 2;
    width = Twidth;
}

int Wall :: get_length () {
    return length;
}

int Wall :: get_angle () {
    return angle;
}

void Wall::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
{
    painter->setBrush(Qt::black);
    painter->drawRect(-width/2 , -length/2 , width/2 , length/2);
}

void Wall::advance(int step) {}

QRectF Wall::boundingRect() const
{
    qreal adjust = 0;
    return QRectF(-width/2-adjust , -length/2-adjust ,
                  width/2+adjust , length/2+adjust);
}

